#pragma once
#include <Windows.h>
#include <osgText/Text>
#include <osgViewer/Viewer>

class OSGRender
{
public:
    OSGRender();
    ~OSGRender();

    void setWindowRect(int x, int y, int w, int h);
    void setClearColorf(float r, float g, float b);
    void setClearColorub(unsigned char r, unsigned char g, unsigned char b);

    void init();

    void run();

    void updateText(const std::string& msg);

    void handleKeyUp(int key);
    void handleResize(int x, int y, int w, int h);

protected:

    osg::Vec4i _winRect;
    osg::Vec4f _clearColor;
    
    osgViewer::Viewer _viewer;
    osg::ref_ptr<osg::Switch> _scene;

    osg::ref_ptr<osg::Camera> _hudText;
    osg::ref_ptr<osgText::Text> _text;

};

